package com.example.controller.Admin;

import com.example.pojo.VO.Result;
import com.example.pojo.entrity.Users;
import com.example.service.AdminService;
import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

//    获取用户信息
    @GetMapping("/getUsers")
    public Result  getUsers()
    {
        log.info("获取用户数据");
        return adminService.getUsers();
    }
//    添加用户

    @PostMapping("/addUser")
    public Result addUser(@RequestBody Users users)
    {
//        TODO 添加用户
        log.info("添加成功");
        return Result.success("添加成功");
    }

//    删除用户
    @DeleteMapping("/deleteUser")
    public Result deleteUser(String userId)
    {
        log.info("删除用户");
        return null;
    }

//    修改用户信息
    @PutMapping("updateUser")
    public Result updateUser()
    {
        log.info("修改数据信息");
        return null;
    }

}
